using System;


namespace Open.Data.Persistence
{
	public abstract class View<T>: IPersistable, IView
    where T: class, IPersistable
	{
        //Property variables
        private Concurrency _concurrency;

        #region Interface

        //Constructors
        public View()
        {
        }

        //Properties
        public virtual Concurrency Concurrency
        {
            get
            {
                return _concurrency;
            }
            set
            {
                _concurrency = value;
            }
        }

        //Methods
        public Type UnderlyingType()
        {
            return typeof(T);
        }

        public virtual void Select(Command command)
        {
            if (command == null) throw new ArgumentNullException("command");
            command.Select(this);
        }

        #endregion
	}
}
